package com.ctshk.task.worker.processors;

import com.ctshk.rpc.iotc.service.IOperateBankPreferenceService;
import com.ctshk.rpc.iotc.service.IOperatePromotionService;
import com.github.kfcfans.powerjob.worker.core.processor.ProcessResult;
import com.github.kfcfans.powerjob.worker.core.processor.TaskContext;
import com.github.kfcfans.powerjob.worker.core.processor.sdk.BasicProcessor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

/**
 * 推广码和银联优惠失效时间任务（1分钟一次）
 *
 * @author 谢诗宏
 * @since 2021-1-20
 */
@Component
public class OperateProcessor implements BasicProcessor {

    @DubboReference
    private IOperateBankPreferenceService operateBankPreferenceService;
    @DubboReference
    private IOperatePromotionService operatePromotionService;

    @Override
    public ProcessResult process(TaskContext context) {
        operatePromotionService.reflush();
        operateBankPreferenceService.reflush();
        return new ProcessResult(true, "定时检查修改推广码有效状态~");
    }
}
